package com.invexer.baosteel.cashflow.mvc.controller.init {
import com.invexer.baosteel.cashflow.mvc.model.CashflowConfigModel;
import com.invexer.baosteel.cashflow.mvc.model.CashflowModel;
import com.invexer.common.puremvc.patterns.command.InvexerSimpleCommandBase;

import org.puremvc.as3.multicore.interfaces.INotification;

public class CashflowInitModelsCMD extends InvexerSimpleCommandBase {
	override public function execute(notification:INotification):void{
		super.execute(notification);
		
		facade.registerProxy(new CashflowConfigModel());
		facade.registerProxy(new CashflowModel());


		initConfigModel(notification.getBody().appConfig);
	}

	private function initConfigModel(config:Object):void{
		var configModel:CashflowConfigModel = facade.retrieveProxy(CashflowConfigModel.NAME) as CashflowConfigModel;
		configModel.config = config;
	}
}
}
